$slash: "/";

.aspect-square {
  aspect-ratio: 1 / 1;
}

.flex {
  display: flex;
}

.grid {
  display: grid;
}

.block {
  display: block;
}

.hidden {
  display: none;
}

.inline {
  display: inline;
}

.inline-block {
  display: inline-block;
}

.inline-grid {
  display: inline-grid;
}

.flex-1 {
  flex: 1;
}

.shrink-0 {
  flex-shrink: 0;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

// Flex Direction
.flex-row {
  flex-direction: row;
}

.flex-col {
  flex-direction: column;
}

// Flex Wrap
.flex-wrap {
  flex-wrap: wrap;
}

.flex-nowrap {
  flex-wrap: nowrap;
}

// Float
.float-left {
  float: left;
}

.float-right {
  float: right;
}

.float-none {
  float: none;
}

.clear-both {
  clear: both;
}

// Object Fit
.object-contain {
  object-fit: contain;
}

.object-cover {
  object-fit: cover;
}

.object-fill {
  object-fit: fill;
}

.object-none {
  object-fit: none;
}

.object-scale-down {
  object-fit: scale-down;
}

// Overflow
.overflow-auto {
  overflow: auto;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-visible {
  overflow: visible;
}

.overflow-x-scroll {
  overflow-x: scroll;

  &::-webkit-scrollbar {
    display: none;
    width: 0 !important;
    height: 0 !important;
    -webkit-appearance: none;
    background: transparent;
  }
}

.overflow-y-scroll {
  overflow-y: scroll;

  &::-webkit-scrollbar {
    display: none;
    width: 0 !important;
    height: 0 !important;
    -webkit-appearance: none;
    background: transparent;
  }
}

.overflow-y-hidden {
  overflow-y: hidden;
}

// Visible
.visible {
  visibility: visible;
}

.invisible {
  visibility: hidden;
}

// Justify Content
.justify-start {
  justify-content: flex-start;
}

.justify-end {
  justify-content: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-around {
  justify-content: space-around;
}

// Justify Items
.justify-items-start {
  justify-items: flex-start;
}

.justify-items-end {
  justify-items: flex-end;
}

.justify-items-center {
  justify-items: center;
}

// Align Items
.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.items-center {
  align-items: center;
}

.items-baseline {
  align-items: baseline;
}

// Gap
@for $i from 0 through 40 {
  @if $i % 2==0 or $i % 5==0 {
    .gap-#{$i} {
      gap: $i + rpx;
    }

    .gap-y-#{$i} {
      row-gap: $i + rpx;
    }

    .gap-x-#{$i} {
      column-gap: $i + rpx;
    }
  }
}

// Grid Template Columns
@for $i from 1 through 6 {
  .grid-cols-#{$i} {
    grid-template-columns: repeat($i, minmax(0, 1fr));
  }

  .grid-rows-#{$i} {
    grid-template-rows: repeat($i, minmax(0, 1fr));
  }
}

// Padding
@for $i from 0 through 100 {
  @if $i % 2==0 or $i % 5==0 {
    .p-#{$i} {
      padding: $i + rpx;
    }

    .pt-#{$i} {
      padding-top: $i + rpx;
    }

    .pr-#{$i} {
      padding-right: $i + rpx;
    }

    .pb-#{$i} {
      padding-bottom: $i + rpx;
    }

    .pl-#{$i} {
      padding-left: $i + rpx;
    }

    .px-#{$i} {
      padding-left: $i + rpx;
      padding-right: $i + rpx;
    }

    .py-#{$i} {
      padding-top: $i + rpx;
      padding-bottom: $i + rpx;
    }
  }
}

// Margin
@for $i from 0 through 60 {
  @if $i % 2==0 or $i % 5==0 {
    .m-#{$i} {
      margin: $i + rpx;
    }

    .mt-#{$i} {
      margin-top: $i + rpx;
    }

    .mr-#{$i} {
      margin-right: $i + rpx;
    }

    .mb-#{$i} {
      margin-bottom: $i + rpx;
    }

    .ml-#{$i} {
      margin-left: $i + rpx;
    }

    .mx-#{$i} {
      margin-left: $i + rpx;
      margin-right: $i + rpx;
    }

    .my-#{$i} {
      margin-top: $i + rpx;
      margin-bottom: $i + rpx;
    }
  }
}

.mt-auto {
  margin-top: auto;
}

.mr-auto {
  margin-right: auto;
}

.mb-auto {
  margin-bottom: auto;
}

.ml-auto {
  margin-left: auto;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

// Zindex
@for $i from 1 through 12 {
  .z-#{$i} {
    z-index: $i * 10;
  }
}

// Position
.fixed {
  position: fixed;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.sticky {
  position: sticky;
}

// Width
.center-msg {
  width: auto;
}

.w-full {
  width: 100%;
}

.w-screen {
  width: 100vw;
}

// Height
.h-full {
  height: 100%;
}

.h-screen {
  height: 100vw;
}

// Min
.min-w-full {
  min-width: 100%;
}

.min-h-full {
  min-height: 100%;
}

// Text
@for $i from 18 through 70 {
  @if $i % 2==0 or $i % 5==0 {
    .font-#{$i} {
      font-size: $i + rpx;
    }
  }
}

@for $i from 4 through 7 {
  .font-#{$i * 100} {
    font-weight: $i * 100;
  }
}

.font-bold {
  font-weight: bold;
}

// Line Height
.text-line-1 {
  line-height: 1;
}

.text-line-15 {
  line-height: 1.5;
}

.text-line-20 {
  line-height: 2;
}

// Text Align
.text-left {
  text-align: left;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-top {
  vertical-align: top;
}

.text-middle {
  vertical-align: middle;
}

.text-bottom {
  vertical-align: bottom;
}

// Whitespace
.whitespace-nowrap {
  white-space: nowrap;
}

.whitespace-pre {
  white-space: pre;
}

.whitespace-pre-wrap {
  white-space: pre-wrap;
}

.break-word {
  word-break: break-all;
}

.break-all {
  word-break: break-all;
}

.break-keep {
  word-break: keep-all;
}

// Border Radius
@for $i from 0 through 30 {
  @if $i % 2==0 or $i % 5==0 {
    .radius-#{$i} {
      border-radius: $i + rpx;
    }

    .radius-tl-#{$i} {
      border-top-left-radius: $i + rpx;
    }

    .radius-tr-#{$i} {
      border-top-right-radius: $i + rpx;
    }

    .radius-bl-#{$i} {
      border-bottom-left-radius: $i + rpx;
    }

    .radius-br-#{$i} {
      border-bottom-right-radius: $i + rpx;
    }
  }
}

.radius-full {
  border-radius: 9999rpx;
}

// Border
@for $i from 1 through 5 {

  .solid-#{$i},
  .dashed-#{$i} {
    position: relative;
    border-color: #eee;
  }

  .solid-#{$i}::after {
    content: " ";
    width: 200%;
    height: 200%;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: inherit;
    transform: scale(0.5);
    transform-origin: 0 0;
    pointer-events: none;
    box-sizing: border-box;
    border: $i + rpx solid #eee;
    border-color: inherit;
  }

  .dashed-#{$i}::after {
    content: " ";
    width: 200%;
    height: 200%;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: inherit;
    transform: scale(0.5);
    transform-origin: 0 0;
    pointer-events: none;
    box-sizing: border-box;
    border: $i + rpx dashed #eee;
    border-color: inherit;
  }

  @each $direction in left,
  top,
  right,
  bottom {

    .solid-#{$direction}-#{$i},
    .dashed-#{$direction}-#{$i} {
      position: relative;
      border-#{$direction}-color: #eee;
    }

    .solid-#{$direction}-#{$i}::after {
      z-index: 1;
      content: " ";
      width: 200%;
      height: 200%;
      position: absolute;
      top: 0;
      left: 0;
      border-radius: inherit;
      transform: scale(0.5);
      transform-origin: 0 0;
      pointer-events: none;
      box-sizing: border-box;
      border-#{$direction}: $i + rpx solid #eee;
      border-#{$direction}-color: inherit;
    }

    .dashed-#{$direction}-#{$i}::after {
      z-index: 1;
      content: " ";
      width: 200%;
      height: 200%;
      position: absolute;
      top: 0;
      left: 0;
      border-radius: inherit;
      transform: scale(0.5);
      transform-origin: 0 0;
      pointer-events: none;
      box-sizing: border-box;
      border-#{$direction}: $i + rpx dashed #eee;
      border-#{$direction}-color: inherit;
    }
  }
}

// Text Row
@for $i from 1 through 6 {
  .text-row-#{$i} {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: $i;
  }
}

// Opacity
@for $i from 0 through 10 {
  .opacity-#{$i} {
    opacity: $i / 10;
  }
}

// Colors
@for $i from 0 through 9 {
  .text-#{$i * 111} {
    color: #{"#"}$i * 111;
  }
}

.text-aaa {
  color: #aaaaaa;
}

.text-bbb {
  color: #bbbbbb;
}

.text-ccc {
  color: #cccccc;
}

.transition {
  transition: all 0.3s ease;
}

.transform-rotate-180 {
  transform: rotate(-180deg);
}

// Animation
.rotate-animation {
  animation: rotate 1s linear infinite;

  @keyframes rotate {
    from {
      transform: rotate(0deg);
    }

    to {
      transform: rotate(360deg);
    }
  }
}

// Background Color
.bg-white {
  background-color: #ffffff;
}

// Click
.click-fade:active {
  opacity: 0.6;
}

.click-animation {
  /* #ifndef MP-WEIXIN */
  cursor: pointer;
  /* #endif */

  &:active {
    transform: translate(1rpx, 1rpx);
  }
}

.bg-grey {
  background-color: #f9fafa;
}

.bg-page {
  background-color: #f4f6f7;
}

.text-Abc {
  text-transform: Capitalize;
}

.text-ABC {
  text-transform: Uppercase;
}

.text-abc {
  text-transform: Lowercase;
}

.text-underline {
  text-decoration: underline;
}

.text-line-through {
  text-decoration: line-through;
}

.text-price-before::before {
  content: "¥";
  font-size: 100%;
  margin-right: 4rpx;
}

.text-price-mini-before::before {
  content: "¥";
  font-size: 60%;
  margin-right: 4rpx;
}

.text-price-small-before::before {
  content: "¥";
  font-size: 80%;
  margin-right: 4rpx;
}

.text-required::before {
  content: "*";
  color: #ff3333;
  font-size: 80%;
  margin-right: 2upx;
}

.text-price {
  color: #de281a;
}

.text-discount {
  color: #fd7441;
}

.text-gray {
  color: #aaaaaa;
}

.text-ccc {
  color: #cccccc;
}

.text-white {
  color: #ffffff;
}

.text-theme {
  color: var(--theme-color);
}

.bg-theme {
  background-color: var(--theme-color);
}

.bg-page {
  background-color: var(--page-color);
}

.gray-page {
  filter: grayscale(100%);
}

// 盒模型
view,
scroll-view,
swiper,
button,
input,
textarea,
label,
navigator,
image {
  flex-shrink: 0;
  box-sizing: border-box;
}

// 文本元素样式
text {
  word-break: break-all;
  white-space: pre-wrap;
  line-break: anywhere;
}